package com.yonyou.crm.sact.visitrule.rmimpl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yonyou.crm.common.page.entity.Page;
import com.yonyou.crm.sact.visitrule.entity.VisitruleTaskcardVO;
import com.yonyou.crm.sact.visitrule.entity.VisitruleVO;
import com.yonyou.crm.sact.visitrule.rmitf.IVisitruleRmService;
import com.yonyou.crm.sact.visitrule.service.VisitruleBizServiceImpl;

@Service("visitruleService")
public class VisitruleRmServiceImpl implements IVisitruleRmService {

	@Autowired
	private VisitruleBizServiceImpl service;
	
	@Override
	public Page<VisitruleVO> list(Page<VisitruleVO> page,
			Map<String, Object> paraMap) {
		return service.getVisitruleList(page, paraMap);
	}

	@Override
	public VisitruleVO detail(Long id) {
		return service.getVOById(VisitruleVO.class, id);
	}

	@Override
	public VisitruleVO insert(VisitruleVO vo) {
		return service.saveVO(vo);
	}

	@Override
	public void update(VisitruleVO vo) {
		service.updateVO(vo);
	}

	@Override
	public Page<VisitruleVO> batchDelete(String[] ids, Page<VisitruleVO> page,Map<String, Object> paraMap) {
		service.batchDeleteByIDs(VisitruleVO.class, ids);
		return service.getVisitruleList(page, paraMap);
	}

	@Override
	public List<VisitruleVO> batchUpdateEnableState(String[] ids, Integer enableState, Map<String, Object> paraMap) {
		service.batchUpdateEnableState(ids, enableState);
		return service.getList(paraMap);
	}

	@Override
	public List<VisitruleVO> refList(Map<String, Object> paraMap) {
		return service.getRefList(paraMap);
	}
	
	/*********拜访规则2.0**********/
	
	@Override
	public List<VisitruleVO> list(Map<String, Object> paraMap) {
		return service.getList(paraMap);
	}

	@Override
	public void saveVT(List<VisitruleTaskcardVO> vtVOs,
			Long visitruleId) {
		service.updateVT(vtVOs, visitruleId);
	}

	@Override
	public void savePresetedVisitrule(Long orgId) {
		service.savePresetedVisitrule(orgId);
	}
}
